home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 March / PCWMAR09.iso / Software / Freeware / NSIS 2.41 / nsis-2.41-setup.exe / Include / WordFunc.nsh < prev    next >
Encoding:
Text File  |  2007-12-22  |  42.6 KB  |  2,209 lines

  1. /*
  2. _____________________________________________________________________________
  3.  
  4.                        Word Functions Header v3.3
  5. _____________________________________________________________________________
  6.  
  7.  2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
  8.  
  9.  See documentation for more information about the following functions.
  10.  
  11.  Usage in script:
  12.  1. !include "WordFunc.nsh"
  13.  2. !insertmacro WordFunction
  14.  3. [Section|Function]
  15.       ${WordFunction} "Param1" "Param2" "..." $var
  16.     [SectionEnd|FunctionEnd]
  17.  
  18.  
  19.  WordFunction=[WordFind|WordFindS|WordFind2X|WordFind2XS|WordFind3X|WordFind3XS|
  20.                WordReplace|WordReplaceS|WordAdd|WordAddS|WordInsert|WordInsertS|
  21.                StrFilter|StrFilterS|VersionCompare|VersionConvert]
  22.  
  23.  un.WordFunction=[un.WordFind|un.WordFindS|un.WordFind2X|un.WordFind2XS|
  24.                   un.WordFind3X|un.WordFind3XS|un.WordReplace|un.WordReplaceS|
  25.                   un.WordAdd|un.WordAddS|un.WordInsert|un.WordInsertS|
  26.                   un.StrFilter|un.StrFilterS|un.VersionCompare|un.VersionConvert]
  27.  
  28. _____________________________________________________________________________
  29.  
  30.                        Thanks to:
  31. _____________________________________________________________________________
  32.  
  33. WordFind3X
  34.     Afrow UK (Based on his idea of Function "StrSortLR")
  35. StrFilter
  36.     sunjammer (Function "StrUpper")
  37. VersionCompare
  38.     Afrow UK (Based on his Function "VersionCheckNew2")
  39. VersionConvert
  40.     Afrow UK (Based on his idea of Function "CharIndexReplace")
  41. */
  42.  
  43.  
  44. ;_____________________________________________________________________________
  45. ;
  46. ;                         Macros
  47. ;_____________________________________________________________________________
  48. ;
  49. ; Change log window verbosity (default: 3=no script)
  50. ;
  51. ; Example:
  52. ; !include "WordFunc.nsh"
  53. ; !insertmacro WordFind
  54. ; ${WORDFUNC_VERBOSE} 4   # all verbosity
  55. ; !insertmacro WordReplace
  56. ; ${WORDFUNC_VERBOSE} 3   # no script
  57.  
  58. !ifndef WORDFUNC_INCLUDED
  59. !define WORDFUNC_INCLUDED
  60.  
  61. !verbose push
  62. !verbose 3
  63. !ifndef _WORDFUNC_VERBOSE
  64.     !define _WORDFUNC_VERBOSE 3
  65. !endif
  66. !verbose ${_WORDFUNC_VERBOSE}
  67. !define WORDFUNC_VERBOSE `!insertmacro WORDFUNC_VERBOSE`
  68. !define _WORDFUNC_UN
  69. !define _WORDFUNC_S
  70. !verbose pop
  71.  
  72. !macro WORDFUNC_VERBOSE _VERBOSE
  73.     !verbose push
  74.     !verbose 3
  75.     !undef _WORDFUNC_VERBOSE
  76.     !define _WORDFUNC_VERBOSE ${_VERBOSE}
  77.     !verbose pop
  78. !macroend
  79.  
  80.  
  81. # Install. Case insensitive. #
  82.  
  83. !macro WordFindCall _STRING _DELIMITER _OPTION _RESULT
  84.     !verbose push
  85.     !verbose ${_WORDFUNC_VERBOSE}
  86.     Push `${_STRING}`
  87.     Push `${_DELIMITER}`
  88.     Push `${_OPTION}`
  89.     Call WordFind
  90.     Pop ${_RESULT}
  91.     !verbose pop
  92. !macroend
  93.  
  94. !macro WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  95.     !verbose push
  96.     !verbose ${_WORDFUNC_VERBOSE}
  97.     Push `${_STRING}`
  98.     Push `${_DELIMITER1}`
  99.     Push `${_DELIMITER2}`
  100.     Push `${_NUMBER}`
  101.     Call WordFind2X
  102.     Pop ${_RESULT}
  103.     !verbose pop
  104. !macroend
  105.  
  106. !macro WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  107.     !verbose push
  108.     !verbose ${_WORDFUNC_VERBOSE}
  109.     Push `${_STRING}`
  110.     Push `${_DELIMITER1}`
  111.     Push `${_CENTER}`
  112.     Push `${_DELIMITER2}`
  113.     Push `${_NUMBER}`
  114.     Call WordFind3X
  115.     Pop ${_RESULT}
  116.     !verbose pop
  117. !macroend
  118.  
  119. !macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  120.     !verbose push
  121.     !verbose ${_WORDFUNC_VERBOSE}
  122.     Push `${_STRING}`
  123.     Push `${_WORD1}`
  124.     Push `${_WORD2}`
  125.     Push `${_NUMBER}`
  126.     Call WordReplace
  127.     Pop ${_RESULT}
  128.     !verbose pop
  129. !macroend
  130.  
  131. !macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
  132.     !verbose push
  133.     !verbose ${_WORDFUNC_VERBOSE}
  134.     Push `${_STRING1}`
  135.     Push `${_DELIMITER}`
  136.     Push `${_STRING2}`
  137.     Call WordAdd
  138.     Pop ${_RESULT}
  139.     !verbose pop
  140. !macroend
  141.  
  142. !macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  143.     !verbose push
  144.     !verbose ${_WORDFUNC_VERBOSE}
  145.     Push `${_STRING}`
  146.     Push `${_DELIMITER}`
  147.     Push `${_WORD}`
  148.     Push `${_NUMBER}`
  149.     Call WordInsert
  150.     Pop ${_RESULT}
  151.     !verbose pop
  152. !macroend
  153.  
  154. !macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  155.     !verbose push
  156.     !verbose ${_WORDFUNC_VERBOSE}
  157.     Push `${_STRING}`
  158.     Push `${_FILTER}`
  159.     Push `${_INCLUDE}`
  160.     Push `${_EXCLUDE}`
  161.     Call StrFilter
  162.     Pop ${_RESULT}
  163.     !verbose pop
  164. !macroend
  165.  
  166. !macro VersionCompareCall _VER1 _VER2 _RESULT
  167.     !verbose push
  168.     !verbose ${_WORDFUNC_VERBOSE}
  169.     Push `${_VER1}`
  170.     Push `${_VER2}`
  171.     Call VersionCompare
  172.     Pop ${_RESULT}
  173.     !verbose pop
  174. !macroend
  175.  
  176. !macro VersionConvertCall _VERSION _CHARLIST _RESULT
  177.     !verbose push
  178.     !verbose ${_WORDFUNC_VERBOSE}
  179.     Push `${_VERSION}`
  180.     Push `${_CHARLIST}`
  181.     Call VersionConvert
  182.     Pop ${_RESULT}
  183.     !verbose pop
  184. !macroend
  185.  
  186. !macro WordFind
  187.     !ifndef ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  188.         !verbose push
  189.         !verbose ${_WORDFUNC_VERBOSE}
  190.         !define ${_WORDFUNC_UN}WordFind${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}Call`
  191.  
  192.         Function ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  193.             Exch $1
  194.             Exch
  195.             Exch $0
  196.             Exch
  197.             Exch 2
  198.             Exch $R0
  199.             Exch 2
  200.             Push $2
  201.             Push $3
  202.             Push $4
  203.             Push $5
  204.             Push $6
  205.             Push $7
  206.             Push $8
  207.             Push $9
  208.             Push $R1
  209.             Push $R2
  210.             ClearErrors
  211.  
  212.             StrCpy $9 ''
  213.             StrCpy $2 $1 1
  214.             StrCpy $1 $1 '' 1
  215.             StrCmp $2 'E' 0 +3
  216.             StrCpy $9 E
  217.             goto -4
  218.  
  219.             StrCpy $3 ''
  220.             StrCmp${_WORDFUNC_S} $2 '+' +6
  221.             StrCmp${_WORDFUNC_S} $2 '-' +5
  222.             StrCmp${_WORDFUNC_S} $2 '/' restart
  223.             StrCmp${_WORDFUNC_S} $2 '#' restart
  224.             StrCmp${_WORDFUNC_S} $2 '*' restart
  225.             goto error3
  226.  
  227.             StrCpy $4 $1 1 -1
  228.             StrCmp${_WORDFUNC_S} $4 '*' +4
  229.             StrCmp${_WORDFUNC_S} $4 '}' +3
  230.             StrCmp${_WORDFUNC_S} $4 '{' +2
  231.             goto +4
  232.             StrCpy $1 $1 -1
  233.             StrCpy $3 '$4$3'
  234.             goto -7
  235.             StrCmp${_WORDFUNC_S} $3 '*' error3
  236.             StrCmp${_WORDFUNC_S} $3 '**' error3
  237.             StrCmp${_WORDFUNC_S} $3 '}{' error3
  238.             IntOp $1 $1 + 0
  239.             StrCmp${_WORDFUNC_S} $1 0 error2
  240.  
  241.             restart:
  242.             StrCmp${_WORDFUNC_S} $R0 '' error1
  243.             StrCpy $4 0
  244.             StrCpy $5 0
  245.             StrCpy $6 0
  246.             StrLen $7 $0
  247.             goto loop
  248.  
  249.             preloop:
  250.             IntOp $6 $6 + 1
  251.  
  252.             loop:
  253.             StrCpy $8 $R0 $7 $6
  254.             StrCmp${_WORDFUNC_S} $8$5 0 error1
  255.             StrLen $R2 $8
  256.             IntCmp $R2 0 +2
  257.             StrCmp${_WORDFUNC_S} $8 $0 +5 preloop
  258.             StrCmp${_WORDFUNC_S} $3 '{' minus
  259.             StrCmp${_WORDFUNC_S} $3 '}' minus
  260.             StrCmp${_WORDFUNC_S} $2 '*' minus
  261.             StrCmp${_WORDFUNC_S} $5 $6 minus +5
  262.             StrCmp${_WORDFUNC_S} $3 '{' +4
  263.             StrCmp${_WORDFUNC_S} $3 '}' +3
  264.             StrCmp${_WORDFUNC_S} $2 '*' +2
  265.             StrCmp${_WORDFUNC_S} $5 $6 nextword
  266.             IntOp $4 $4 + 1
  267.             StrCmp${_WORDFUNC_S} $2$4 +$1 plus
  268.             StrCmp${_WORDFUNC_S} $2 '/' 0 nextword
  269.             IntOp $8 $6 - $5
  270.             StrCpy $8 $R0 $8 $5
  271.             StrCmp${_WORDFUNC_S} $1 $8 0 nextword
  272.             StrCpy $R1 $4
  273.             goto end
  274.             nextword:
  275.             IntOp $6 $6 + $7
  276.             StrCpy $5 $6
  277.             goto loop
  278.  
  279.             minus:
  280.             StrCmp${_WORDFUNC_S} $2 '-' 0 sum
  281.             StrCpy $2 '+'
  282.             IntOp $1 $4 - $1
  283.             IntOp $1 $1 + 1
  284.             IntCmp $1 0 error2 error2 restart
  285.             sum:
  286.             StrCmp${_WORDFUNC_S} $2 '#' 0 sumdelim
  287.             StrCpy $R1 $4
  288.             goto end
  289.             sumdelim:
  290.             StrCmp${_WORDFUNC_S} $2 '*' 0 error2
  291.             StrCpy $R1 $4
  292.             goto end
  293.  
  294.             plus:
  295.             StrCmp${_WORDFUNC_S} $3 '' 0 +4
  296.             IntOp $6 $6 - $5
  297.             StrCpy $R1 $R0 $6 $5
  298.             goto end
  299.             StrCmp${_WORDFUNC_S} $3 '{' 0 +3
  300.             StrCpy $R1 $R0 $6
  301.             goto end
  302.             StrCmp${_WORDFUNC_S} $3 '}' 0 +4
  303.             IntOp $6 $6 + $7
  304.             StrCpy $R1 $R0 '' $6
  305.             goto end
  306.             StrCmp${_WORDFUNC_S} $3 '{*' +2
  307.             StrCmp${_WORDFUNC_S} $3 '*{' 0 +3
  308.             StrCpy $R1 $R0 $6
  309.             goto end
  310.             StrCmp${_WORDFUNC_S} $3 '*}' +2
  311.             StrCmp${_WORDFUNC_S} $3 '}*' 0 +3
  312.             StrCpy $R1 $R0 '' $5
  313.             goto end
  314.             StrCmp${_WORDFUNC_S} $3 '}}' 0 +3
  315.             StrCpy $R1 $R0 '' $6
  316.             goto end
  317.             StrCmp${_WORDFUNC_S} $3 '{{' 0 +3
  318.             StrCpy $R1 $R0 $5
  319.             goto end
  320.             StrCmp${_WORDFUNC_S} $3 '{}' 0 error3
  321.             StrLen $3 $R0
  322.             StrCmp${_WORDFUNC_S} $3 $6 0 +3
  323.             StrCpy $0 ''
  324.             goto +2
  325.             IntOp $6 $6 + $7
  326.             StrCpy $8 $R0 '' $6
  327.             StrCmp${_WORDFUNC_S} $4$8 1 +6
  328.             StrCmp${_WORDFUNC_S} $4 1 +2 +7
  329.             IntOp $6 $6 + $7
  330.             StrCpy $3 $R0 $7 $6
  331.             StrCmp${_WORDFUNC_S} $3 '' +2
  332.             StrCmp${_WORDFUNC_S} $3 $0 -3 +3
  333.             StrCpy $R1 ''
  334.             goto end
  335.             StrCmp${_WORDFUNC_S} $5 0 0 +3
  336.             StrCpy $0 ''
  337.             goto +2
  338.             IntOp $5 $5 - $7
  339.             StrCpy $3 $R0 $5
  340.             StrCpy $R1 '$3$0$8'
  341.             goto end
  342.  
  343.             error3:
  344.             StrCpy $R1 3
  345.             goto error
  346.             error2:
  347.             StrCpy $R1 2
  348.             goto error
  349.             error1:
  350.             StrCpy $R1 1
  351.             error:
  352.             StrCmp $9 'E' 0 +3
  353.             SetErrors
  354.  
  355.             end:
  356.             StrCpy $R0 $R1
  357.  
  358.             Pop $R2
  359.             Pop $R1
  360.             Pop $9
  361.             Pop $8
  362.             Pop $7
  363.             Pop $6
  364.             Pop $5
  365.             Pop $4
  366.             Pop $3
  367.             Pop $2
  368.             Pop $1
  369.             Pop $0
  370.             Exch $R0
  371.         FunctionEnd
  372.  
  373.         !verbose pop
  374.     !endif
  375. !macroend
  376.  
  377. !macro WordFind2X
  378.     !ifndef ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
  379.         !verbose push
  380.         !verbose ${_WORDFUNC_VERBOSE}
  381.         !define ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}Call`
  382.  
  383.         Function ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
  384.             Exch $2
  385.             Exch
  386.             Exch $1
  387.             Exch
  388.             Exch 2
  389.             Exch $0
  390.             Exch 2
  391.             Exch 3
  392.             Exch $R0
  393.             Exch 3
  394.             Push $3
  395.             Push $4
  396.             Push $5
  397.             Push $6
  398.             Push $7
  399.             Push $8
  400.             Push $9
  401.             Push $R1
  402.             Push $R2
  403.             ClearErrors
  404.  
  405.             StrCpy $R2 ''
  406.             StrCpy $3 $2 1
  407.             StrCpy $2 $2 '' 1
  408.             StrCmp $3 'E' 0 +3
  409.             StrCpy $R2 E
  410.             goto -4
  411.  
  412.             StrCmp${_WORDFUNC_S} $3 '+' +5
  413.             StrCmp${_WORDFUNC_S} $3 '-' +4
  414.             StrCmp${_WORDFUNC_S} $3 '#' restart
  415.             StrCmp${_WORDFUNC_S} $3 '/' restart
  416.             goto error3
  417.  
  418.             StrCpy $4 $2 2 -2
  419.             StrCmp${_WORDFUNC_S} $4 '{{' +9
  420.             StrCmp${_WORDFUNC_S} $4 '}}' +8
  421.             StrCmp${_WORDFUNC_S} $4 '{*' +7
  422.             StrCmp${_WORDFUNC_S} $4 '*{' +6
  423.             StrCmp${_WORDFUNC_S} $4 '*}' +5
  424.             StrCmp${_WORDFUNC_S} $4 '}*' +4
  425.             StrCmp${_WORDFUNC_S} $4 '{}' +3
  426.             StrCpy $4 ''
  427.             goto +2
  428.             StrCpy $2 $2 -2
  429.             IntOp $2 $2 + 0
  430.             StrCmp${_WORDFUNC_S} $2 0 error2
  431.  
  432.             restart:
  433.             StrCmp${_WORDFUNC_S} $R0 '' error1
  434.             StrCpy $5 -1
  435.             StrCpy $6 0
  436.             StrCpy $7 ''
  437.             StrLen $8 $0
  438.             StrLen $9 $1
  439.  
  440.             loop:
  441.             IntOp $5 $5 + 1
  442.  
  443.             delim1:
  444.             StrCpy $R1 $R0 $8 $5
  445.             StrCmp${_WORDFUNC_S} $R1$6 0 error1
  446.             StrCmp${_WORDFUNC_S} $R1 '' minus
  447.             StrCmp${_WORDFUNC_S} $R1 $0 +2
  448.             StrCmp${_WORDFUNC_S} $7 '' loop delim2
  449.             StrCmp${_WORDFUNC_S} $0 $1 0 +2
  450.             StrCmp${_WORDFUNC_S} $7 '' 0 delim2
  451.             IntOp $7 $5 + $8
  452.             StrCpy $5 $7
  453.             goto delim1
  454.  
  455.             delim2:
  456.             StrCpy $R1 $R0 $9 $5
  457.             StrCmp${_WORDFUNC_S} $R1 $1 0 loop
  458.             IntOp $6 $6 + 1
  459.             StrCmp${_WORDFUNC_S} $3$6 '+$2' plus
  460.             StrCmp${_WORDFUNC_S} $3 '/' 0 nextword
  461.             IntOp $R1 $5 - $7
  462.             StrCpy $R1 $R0 $R1 $7
  463.             StrCmp${_WORDFUNC_S} $R1 $2 0 +3
  464.             StrCpy $R1 $6
  465.             goto end
  466.             nextword:
  467.             IntOp $5 $5 + $9
  468.             StrCpy $7 ''
  469.             goto delim1
  470.  
  471.             minus:
  472.             StrCmp${_WORDFUNC_S} $3 '-' 0 sum
  473.             StrCpy $3 +
  474.             IntOp $2 $6 - $2
  475.             IntOp $2 $2 + 1
  476.             IntCmp $2 0 error2 error2 restart
  477.             sum:
  478.             StrCmp${_WORDFUNC_S} $3 '#' 0 error2
  479.             StrCpy $R1 $6
  480.             goto end
  481.  
  482.             plus:
  483.             StrCmp${_WORDFUNC_S} $4 '' 0 +4
  484.             IntOp $R1 $5 - $7
  485.             StrCpy $R1 $R0 $R1 $7
  486.             goto end
  487.             IntOp $5 $5 + $9
  488.             IntOp $7 $7 - $8
  489.             StrCmp${_WORDFUNC_S} $4 '{*' +2
  490.             StrCmp${_WORDFUNC_S} $4 '*{' 0 +3
  491.             StrCpy $R1 $R0 $5
  492.             goto end
  493.             StrCmp${_WORDFUNC_S} $4 '*}' +2
  494.             StrCmp${_WORDFUNC_S} $4 '}*' 0 +3
  495.             StrCpy $R1 $R0 '' $7
  496.             goto end
  497.             StrCmp${_WORDFUNC_S} $4 '}}' 0 +3
  498.             StrCpy $R1 $R0 '' $5
  499.             goto end
  500.             StrCmp${_WORDFUNC_S} $4 '{{' 0 +3
  501.             StrCpy $R1 $R0 $7
  502.             goto end
  503.             StrCmp${_WORDFUNC_S} $4 '{}' 0 error3
  504.             StrCpy $5 $R0 '' $5
  505.             StrCpy $7 $R0 $7
  506.             StrCpy $R1 '$7$5'
  507.             goto end
  508.  
  509.             error3:
  510.             StrCpy $R1 3
  511.             goto error
  512.             error2:
  513.             StrCpy $R1 2
  514.             goto error
  515.             error1:
  516.             StrCpy $R1 1
  517.             error:
  518.             StrCmp $R2 'E' 0 +3
  519.             SetErrors
  520.  
  521.             end:
  522.             StrCpy $R0 $R1
  523.  
  524.             Pop $R2
  525.             Pop $R1
  526.             Pop $9
  527.             Pop $8
  528.             Pop $7
  529.             Pop $6
  530.             Pop $5
  531.             Pop $4
  532.             Pop $3
  533.             Pop $2
  534.             Pop $1
  535.             Pop $0
  536.             Exch $R0
  537.         FunctionEnd
  538.  
  539.         !verbose pop
  540.     !endif
  541. !macroend
  542.  
  543. !macro WordFind3X
  544.     !ifndef ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
  545.         !verbose push
  546.         !verbose ${_WORDFUNC_VERBOSE}
  547.         !define ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}Call`
  548.  
  549.         Function ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
  550.             Exch $3
  551.             Exch
  552.             Exch $2
  553.             Exch
  554.             Exch 2
  555.             Exch $1
  556.             Exch 2
  557.             Exch 3
  558.             Exch $0
  559.             Exch 3
  560.             Exch 4
  561.             Exch $R0
  562.             Exch 4
  563.             Push $4
  564.             Push $5
  565.             Push $6
  566.             Push $7
  567.             Push $8
  568.             Push $9
  569.             Push $R1
  570.             Push $R2
  571.             Push $R3
  572.             Push $R4
  573.             Push $R5
  574.             ClearErrors
  575.  
  576.             StrCpy $R5 ''
  577.             StrCpy $4 $3 1
  578.             StrCpy $3 $3 '' 1
  579.             StrCmp $4 'E' 0 +3
  580.             StrCpy $R5 E
  581.             goto -4
  582.  
  583.             StrCmp${_WORDFUNC_S} $4 '+' +5
  584.             StrCmp${_WORDFUNC_S} $4 '-' +4
  585.             StrCmp${_WORDFUNC_S} $4 '#' restart
  586.             StrCmp${_WORDFUNC_S} $4 '/' restart
  587.             goto error3
  588.  
  589.             StrCpy $5 $3 2 -2
  590.             StrCmp${_WORDFUNC_S} $5 '{{' +9
  591.             StrCmp${_WORDFUNC_S} $5 '}}' +8
  592.             StrCmp${_WORDFUNC_S} $5 '{*' +7
  593.             StrCmp${_WORDFUNC_S} $5 '*{' +6
  594.             StrCmp${_WORDFUNC_S} $5 '*}' +5
  595.             StrCmp${_WORDFUNC_S} $5 '}*' +4
  596.             StrCmp${_WORDFUNC_S} $5 '{}' +3
  597.             StrCpy $5 ''
  598.             goto +2
  599.             StrCpy $3 $3 -2
  600.             IntOp $3 $3 + 0
  601.             StrCmp${_WORDFUNC_S} $3 0 error2
  602.  
  603.             restart:
  604.             StrCmp${_WORDFUNC_S} $R0 '' error1
  605.             StrCpy $6 -1
  606.             StrCpy $7 0
  607.             StrCpy $8 ''
  608.             StrCpy $9 ''
  609.             StrLen $R1 $0
  610.             StrLen $R2 $1
  611.             StrLen $R3 $2
  612.  
  613.             loop:
  614.             IntOp $6 $6 + 1
  615.  
  616.             delim1:
  617.             StrCpy $R4 $R0 $R1 $6
  618.             StrCmp${_WORDFUNC_S} $R4$7 0 error1
  619.             StrCmp${_WORDFUNC_S} $R4 '' minus
  620.             StrCmp${_WORDFUNC_S} $R4 $0 +2
  621.             StrCmp${_WORDFUNC_S} $8 '' loop center
  622.             StrCmp${_WORDFUNC_S} $0 $1 +2
  623.             StrCmp${_WORDFUNC_S} $0 $2 0 +2
  624.             StrCmp${_WORDFUNC_S} $8 '' 0 center
  625.             IntOp $8 $6 + $R1
  626.             StrCpy $6 $8
  627.             goto delim1
  628.  
  629.             center:
  630.             StrCmp${_WORDFUNC_S} $9 '' 0 delim2
  631.             StrCpy $R4 $R0 $R2 $6
  632.             StrCmp${_WORDFUNC_S} $R4 $1 0 loop
  633.             IntOp $9 $6 + $R2
  634.             StrCpy $6 $9
  635.             goto delim1
  636.  
  637.             delim2:
  638.             StrCpy $R4 $R0 $R3 $6
  639.             StrCmp${_WORDFUNC_S} $R4 $2 0 loop
  640.             IntOp $7 $7 + 1
  641.             StrCmp${_WORDFUNC_S} $4$7 '+$3' plus
  642.             StrCmp${_WORDFUNC_S} $4 '/' 0 nextword
  643.             IntOp $R4 $6 - $8
  644.             StrCpy $R4 $R0 $R4 $8
  645.             StrCmp${_WORDFUNC_S} $R4 $3 0 +3
  646.             StrCpy $R4 $7
  647.             goto end
  648.             nextword:
  649.             IntOp $6 $6 + $R3
  650.             StrCpy $8 ''
  651.             StrCpy $9 ''
  652.             goto delim1
  653.  
  654.             minus:
  655.             StrCmp${_WORDFUNC_S} $4 '-' 0 sum
  656.             StrCpy $4 +
  657.             IntOp $3 $7 - $3
  658.             IntOp $3 $3 + 1
  659.             IntCmp $3 0 error2 error2 restart
  660.             sum:
  661.             StrCmp${_WORDFUNC_S} $4 '#' 0 error2
  662.             StrCpy $R4 $7
  663.             goto end
  664.  
  665.             plus:
  666.             StrCmp${_WORDFUNC_S} $5 '' 0 +4
  667.             IntOp $R4 $6 - $8
  668.             StrCpy $R4 $R0 $R4 $8
  669.             goto end
  670.             IntOp $6 $6 + $R3
  671.             IntOp $8 $8 - $R1
  672.             StrCmp${_WORDFUNC_S} $5 '{*' +2
  673.             StrCmp${_WORDFUNC_S} $5 '*{' 0 +3
  674.             StrCpy $R4 $R0 $6
  675.             goto end
  676.             StrCmp${_WORDFUNC_S} $5 '*}' +2
  677.             StrCmp${_WORDFUNC_S} $5 '}*' 0 +3
  678.             StrCpy $R4 $R0 '' $8
  679.             goto end
  680.             StrCmp${_WORDFUNC_S} $5 '}}' 0 +3
  681.             StrCpy $R4 $R0 '' $6
  682.             goto end
  683.             StrCmp${_WORDFUNC_S} $5 '{{' 0 +3
  684.             StrCpy $R4 $R0 $8
  685.             goto end
  686.             StrCmp${_WORDFUNC_S} $5 '{}' 0 error3
  687.             StrCpy $6 $R0 '' $6
  688.             StrCpy $8 $R0 $8
  689.             StrCpy $R4 '$8$6'
  690.             goto end
  691.  
  692.             error3:
  693.             StrCpy $R4 3
  694.             goto error
  695.             error2:
  696.             StrCpy $R4 2
  697.             goto error
  698.             error1:
  699.             StrCpy $R4 1
  700.             error:
  701.             StrCmp $R5 'E' 0 +3
  702.             SetErrors
  703.  
  704.             end:
  705.             StrCpy $R0 $R4
  706.             Pop $R5
  707.             Pop $R4
  708.             Pop $R3
  709.             Pop $R2
  710.             Pop $R1
  711.             Pop $9
  712.             Pop $8
  713.             Pop $7
  714.             Pop $6
  715.             Pop $5
  716.             Pop $4
  717.             Pop $3
  718.             Pop $2
  719.             Pop $1
  720.             Pop $0
  721.             Exch $R0
  722.         FunctionEnd
  723.  
  724.         !verbose pop
  725.     !endif
  726. !macroend
  727.  
  728. !macro WordReplace
  729.     !ifndef ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
  730.         !verbose push
  731.         !verbose ${_WORDFUNC_VERBOSE}
  732.         !define ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}Call`
  733.  
  734.         Function ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
  735.             Exch $2
  736.             Exch
  737.             Exch $1
  738.             Exch
  739.             Exch 2
  740.             Exch $0
  741.             Exch 2
  742.             Exch 3
  743.             Exch $R0
  744.             Exch 3
  745.             Push $3
  746.             Push $4
  747.             Push $5
  748.             Push $6
  749.             Push $7
  750.             Push $8
  751.             Push $9
  752.             Push $R1
  753.             ClearErrors
  754.  
  755.             StrCpy $R1 $R0
  756.             StrCpy $9 ''
  757.             StrCpy $3 $2 1
  758.             StrCpy $2 $2 '' 1
  759.             StrCmp $3 'E' 0 +3
  760.             StrCpy $9 E
  761.             goto -4
  762.  
  763.             StrCpy $4 $2 1 -1
  764.             StrCpy $5 ''
  765.             StrCpy $6 ''
  766.             StrLen $7 $0
  767.  
  768.             StrCmp${_WORDFUNC_S} $7 0 error1
  769.             StrCmp${_WORDFUNC_S} $R0 '' error1
  770.             StrCmp${_WORDFUNC_S} $3 '{' beginning
  771.             StrCmp${_WORDFUNC_S} $3 '}' ending errorchk
  772.  
  773.             beginning:
  774.             StrCpy $8 $R0 $7
  775.             StrCmp${_WORDFUNC_S} $8 $0 0 +4
  776.             StrCpy $R0 $R0 '' $7
  777.             StrCpy $5 '$5$1'
  778.             goto -4
  779.             StrCpy $3 $2 1
  780.             StrCmp${_WORDFUNC_S} $3 '}' 0 merge
  781.  
  782.             ending:
  783.             StrCpy $8 $R0 '' -$7
  784.             StrCmp${_WORDFUNC_S} $8 $0 0 +4
  785.             StrCpy $R0 $R0 -$7
  786.             StrCpy $6 '$6$1'
  787.             goto -4
  788.  
  789.             merge:
  790.             StrCmp${_WORDFUNC_S} $4 '*' 0 +5
  791.             StrCmp${_WORDFUNC_S} $5 '' +2
  792.             StrCpy $5 $1
  793.             StrCmp${_WORDFUNC_S} $6 '' +2
  794.             StrCpy $6 $1
  795.             StrCpy $R0 '$5$R0$6'
  796.             goto end
  797.  
  798.             errorchk:
  799.             StrCmp${_WORDFUNC_S} $3 '+' +2
  800.             StrCmp${_WORDFUNC_S} $3 '-' 0 error3
  801.  
  802.             StrCpy $5 $2 1
  803.             IntOp $2 $2 + 0
  804.             StrCmp${_WORDFUNC_S} $2 0 0 one
  805.             StrCmp${_WORDFUNC_S} $5 0 error2
  806.             StrCpy $3 ''
  807.  
  808.             all:
  809.             StrCpy $5 0
  810.             StrCpy $2 $R0 $7 $5
  811.             StrCmp${_WORDFUNC_S} $2 '' +4
  812.             StrCmp${_WORDFUNC_S} $2 $0 +6
  813.             IntOp $5 $5 + 1
  814.             goto -4
  815.             StrCmp${_WORDFUNC_S} $R0 $R1 error1
  816.             StrCpy $R0 '$3$R0'
  817.             goto end
  818.             StrCpy $2 $R0 $5
  819.             IntOp $5 $5 + $7
  820.             StrCmp${_WORDFUNC_S} $4 '*' 0 +3
  821.             StrCpy $6 $R0 $7 $5
  822.             StrCmp${_WORDFUNC_S} $6 $0 -3
  823.             StrCpy $R0 $R0 '' $5
  824.             StrCpy $3 '$3$2$1'
  825.             goto all
  826.  
  827.             one:
  828.             StrCpy $5 0
  829.             StrCpy $8 0
  830.             goto loop
  831.  
  832.             preloop:
  833.             IntOp $5 $5 + 1
  834.  
  835.             loop:
  836.             StrCpy $6 $R0 $7 $5
  837.             StrCmp${_WORDFUNC_S} $6$8 0 error1
  838.             StrCmp${_WORDFUNC_S} $6 '' minus
  839.             StrCmp${_WORDFUNC_S} $6 $0 0 preloop
  840.             IntOp $8 $8 + 1
  841.             StrCmp${_WORDFUNC_S} $3$8 +$2 found
  842.             IntOp $5 $5 + $7
  843.             goto loop
  844.  
  845.             minus:
  846.             StrCmp${_WORDFUNC_S} $3 '-' 0 error2
  847.             StrCpy $3 +
  848.             IntOp $2 $8 - $2
  849.             IntOp $2 $2 + 1
  850.             IntCmp $2 0 error2 error2 one
  851.  
  852.             found:
  853.             StrCpy $3 $R0 $5
  854.             StrCmp${_WORDFUNC_S} $4 '*' 0 +5
  855.             StrCpy $6 $3 '' -$7
  856.             StrCmp${_WORDFUNC_S} $6 $0 0 +3
  857.             StrCpy $3 $3 -$7
  858.             goto -3
  859.             IntOp $5 $5 + $7
  860.             StrCmp${_WORDFUNC_S} $4 '*' 0 +3
  861.             StrCpy $6 $R0 $7 $5
  862.             StrCmp${_WORDFUNC_S} $6 $0 -3
  863.             StrCpy $R0 $R0 '' $5
  864.             StrCpy $R0 '$3$1$R0'
  865.             goto end
  866.  
  867.             error3:
  868.             StrCpy $R0 3
  869.             goto error
  870.             error2:
  871.             StrCpy $R0 2
  872.             goto error
  873.             error1:
  874.             StrCpy $R0 1
  875.             error:
  876.             StrCmp $9 'E' +3
  877.             StrCpy $R0 $R1
  878.             goto +2
  879.             SetErrors
  880.  
  881.             end:
  882.             Pop $R1
  883.             Pop $9
  884.             Pop $8
  885.             Pop $7
  886.             Pop $6
  887.             Pop $5
  888.             Pop $4
  889.             Pop $3
  890.             Pop $2
  891.             Pop $1
  892.             Pop $0
  893.             Exch $R0
  894.         FunctionEnd
  895.  
  896.         !verbose pop
  897.     !endif
  898. !macroend
  899.  
  900. !macro WordAdd
  901.     !ifndef ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
  902.         !verbose push
  903.         !verbose ${_WORDFUNC_VERBOSE}
  904.         !insertmacro WordFind
  905.  
  906.         !define ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}Call`
  907.  
  908.         Function ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
  909.             Exch $1
  910.             Exch
  911.             Exch $0
  912.             Exch
  913.             Exch 2
  914.             Exch $R0
  915.             Exch 2
  916.             Push $2
  917.             Push $3
  918.             Push $4
  919.             Push $5
  920.             Push $6
  921.             Push $7
  922.             Push $R1
  923.             ClearErrors
  924.  
  925.             StrCpy $7 ''
  926.             StrCpy $2 $1 1
  927.             StrCmp $2 'E' 0 +4
  928.             StrCpy $7 E
  929.             StrCpy $1 $1 '' 1
  930.             goto -4
  931.  
  932.             StrCpy $5 0
  933.             StrCpy $R1 $R0
  934.             StrCpy $2 $1 '' 1
  935.             StrCpy $1 $1 1
  936.             StrCmp${_WORDFUNC_S} $1 '+' +2
  937.             StrCmp${_WORDFUNC_S} $1 '-' 0 error3
  938.  
  939.             StrCmp${_WORDFUNC_S} $0 '' error1
  940.             StrCmp${_WORDFUNC_S} $2 '' end
  941.             StrCmp${_WORDFUNC_S} $R0 '' 0 +5
  942.             StrCmp${_WORDFUNC_S} $1 '-' end
  943.             StrCmp${_WORDFUNC_S} $1 '+' 0 +3
  944.             StrCpy $R0 $2
  945.             goto end
  946.  
  947.             loop:
  948.             IntOp $5 $5 + 1
  949.             Push `$2`
  950.             Push `$0`
  951.             Push `E+$5`
  952.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  953.             Pop $3
  954.             IfErrors 0 /word
  955.             StrCmp${_WORDFUNC_S} $3 2 +4
  956.             StrCmp${_WORDFUNC_S} $3$5 11 0 +3
  957.             StrCpy $3 $2
  958.             goto /word
  959.             StrCmp${_WORDFUNC_S} $1 '-' end preend
  960.  
  961.             /word:
  962.             Push `$R0`
  963.             Push `$0`
  964.             Push `E/$3`
  965.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  966.             Pop $4
  967.             IfErrors +2
  968.             StrCmp${_WORDFUNC_S} $1 '-' delete loop
  969.             StrCmp${_WORDFUNC_S} $1$4 '-1' +2
  970.             StrCmp${_WORDFUNC_S} $1 '-' loop +4
  971.             StrCmp${_WORDFUNC_S} $R0 $3 0 loop
  972.             StrCpy $R0 ''
  973.             goto end
  974.             StrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2
  975.             StrCmp${_WORDFUNC_S} $R0 $3 loop
  976.             StrCmp${_WORDFUNC_S} $R0 $R1 +3
  977.             StrCpy $R1 '$R1$0$3'
  978.             goto loop
  979.             StrLen $6 $0
  980.             StrCpy $6 $R0 '' -$6
  981.             StrCmp${_WORDFUNC_S} $6 $0 0 -4
  982.             StrCpy $R1 '$R1$3'
  983.             goto loop
  984.  
  985.             delete:
  986.             Push `$R0`
  987.             Push `$0`
  988.             Push `E+$4{}`
  989.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  990.             Pop $R0
  991.             goto /word
  992.  
  993.             error3:
  994.             StrCpy $R1 3
  995.             goto error
  996.             error1:
  997.             StrCpy $R1 1
  998.             error:
  999.             StrCmp $7 'E' 0 end
  1000.             SetErrors
  1001.  
  1002.             preend:
  1003.             StrCpy $R0 $R1
  1004.  
  1005.             end:
  1006.             Pop $R1
  1007.             Pop $7
  1008.             Pop $6
  1009.             Pop $5
  1010.             Pop $4
  1011.             Pop $3
  1012.             Pop $2
  1013.             Pop $1
  1014.             Pop $0
  1015.             Exch $R0
  1016.         FunctionEnd
  1017.  
  1018.         !verbose pop
  1019.     !endif
  1020. !macroend
  1021.  
  1022. !macro WordInsert
  1023.     !ifndef ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
  1024.         !verbose push
  1025.         !verbose ${_WORDFUNC_VERBOSE}
  1026.         !insertmacro WordFind
  1027.  
  1028.         !define ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}Call`
  1029.  
  1030.         Function ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
  1031.             Exch $2
  1032.             Exch
  1033.             Exch $1
  1034.             Exch
  1035.             Exch 2
  1036.             Exch $0
  1037.             Exch 2
  1038.             Exch 3
  1039.             Exch $R0
  1040.             Exch 3
  1041.             Push $3
  1042.             Push $4
  1043.             Push $5
  1044.             Push $6
  1045.             Push $7
  1046.             Push $8
  1047.             Push $9
  1048.             Push $R1
  1049.             ClearErrors
  1050.  
  1051.             StrCpy $5 ''
  1052.             StrCpy $6 $0
  1053.             StrCpy $7 }
  1054.  
  1055.             StrCpy $9 ''
  1056.             StrCpy $R1 $R0
  1057.             StrCpy $3 $2 1
  1058.             StrCpy $2 $2 '' 1
  1059.             StrCmp $3 'E' 0 +3
  1060.             StrCpy $9 'E'
  1061.             goto -4
  1062.  
  1063.             StrCmp${_WORDFUNC_S} $3 '+' +2
  1064.             StrCmp${_WORDFUNC_S} $3 '-' 0 error3
  1065.             IntOp $2 $2 + 0
  1066.             StrCmp${_WORDFUNC_S} $2 0 error2
  1067.             StrCmp${_WORDFUNC_S} $0 '' error1
  1068.  
  1069.             StrCmp${_WORDFUNC_S} $2 1 0 two
  1070.             GetLabelAddress $8 oneback
  1071.             StrCmp${_WORDFUNC_S} $3 '+' call
  1072.             StrCpy $7 {
  1073.             goto call
  1074.             oneback:
  1075.             IfErrors 0 +2
  1076.             StrCpy $4 $R0
  1077.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1078.             StrCpy $R0 '$1$0$4'
  1079.             goto end
  1080.             StrCpy $R0 '$4$0$1'
  1081.             goto end
  1082.  
  1083.             two:
  1084.             IntOp $2 $2 - 1
  1085.             GetLabelAddress $8 twoback
  1086.             StrCmp${_WORDFUNC_S} $3 '+' 0 call
  1087.             StrCpy $7 {
  1088.             goto call
  1089.             twoback:
  1090.             IfErrors 0 tree
  1091.             StrCmp${_WORDFUNC_S} $2$4 11 0 error2
  1092.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1093.             StrCpy $R0 '$R0$0$1'
  1094.             goto end
  1095.             StrCpy $R0 '$1$0$R0'
  1096.             goto end
  1097.  
  1098.             tree:
  1099.             StrCpy $7 }
  1100.             StrCpy $5 $4
  1101.             IntOp $2 $2 + 1
  1102.             GetLabelAddress $8 treeback
  1103.             StrCmp${_WORDFUNC_S} $3 '+' call
  1104.             StrCpy $7 {
  1105.             goto call
  1106.             treeback:
  1107.             IfErrors 0 +3
  1108.             StrCpy $4 ''
  1109.             StrCpy $6 ''
  1110.             StrCmp${_WORDFUNC_S} $3 '+' 0 +3
  1111.             StrCpy $R0 '$5$0$1$6$4'
  1112.             goto end
  1113.             StrCpy $R0 '$4$6$1$0$5'
  1114.             goto end
  1115.  
  1116.             call:            
  1117.             Push '$R0'
  1118.             Push '$0'
  1119.             Push 'E$3$2*$7'
  1120.             Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
  1121.             Pop $4
  1122.             goto $8
  1123.  
  1124.             error3:
  1125.             StrCpy $R0 3
  1126.             goto error
  1127.             error2:
  1128.             StrCpy $R0 2
  1129.             goto error
  1130.             error1:
  1131.             StrCpy $R0 1
  1132.             error:
  1133.             StrCmp $9 'E' +3
  1134.             StrCpy $R0 $R1
  1135.             goto +2
  1136.             SetErrors
  1137.  
  1138.             end:
  1139.             Pop $R1
  1140.             Pop $9
  1141.             Pop $8
  1142.             Pop $7
  1143.             Pop $6
  1144.             Pop $5
  1145.             Pop $4
  1146.             Pop $3
  1147.             Pop $2
  1148.             Pop $1
  1149.             Pop $0
  1150.             Exch $R0
  1151.         FunctionEnd
  1152.  
  1153.         !verbose pop
  1154.     !endif
  1155. !macroend
  1156.  
  1157. !macro StrFilter
  1158.     !ifndef ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
  1159.         !verbose push
  1160.         !verbose ${_WORDFUNC_VERBOSE}
  1161.         !define ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}Call`
  1162.  
  1163.         Function ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
  1164.             Exch $2
  1165.             Exch
  1166.             Exch $1
  1167.             Exch
  1168.             Exch 2
  1169.             Exch $0
  1170.             Exch 2
  1171.             Exch 3
  1172.             Exch $R0
  1173.             Exch 3
  1174.             Push $3
  1175.             Push $4
  1176.             Push $5
  1177.             Push $6
  1178.             Push $7
  1179.             Push $R1
  1180.             Push $R2
  1181.             Push $R3
  1182.             Push $R4
  1183.             Push $R5
  1184.             Push $R6
  1185.             Push $R7
  1186.             Push $R8
  1187.             ClearErrors
  1188.  
  1189.             StrCpy $R2 $0 '' -3
  1190.             StrCmp $R2 eng eng
  1191.             StrCmp $R2 rus rus
  1192.             eng:
  1193.             StrCpy $4 65
  1194.             StrCpy $5 90
  1195.             StrCpy $6 97
  1196.             StrCpy $7 122
  1197.             goto langend
  1198.             rus:
  1199.             StrCpy $4 192
  1200.             StrCpy $5 223
  1201.             StrCpy $6 224
  1202.             StrCpy $7 255
  1203.             goto langend
  1204.             ;...
  1205.  
  1206.             langend:
  1207.             StrCpy $R7 ''
  1208.             StrCpy $R8 ''
  1209.  
  1210.             StrCmp${_WORDFUNC_S} $2 '' 0 begin
  1211.  
  1212.             restart1:
  1213.             StrCpy $2 ''
  1214.             StrCpy $3 $0 1
  1215.             StrCmp${_WORDFUNC_S} $3 '+' +2
  1216.             StrCmp${_WORDFUNC_S} $3 '-' 0 +3
  1217.             StrCpy $0 $0 '' 1
  1218.             goto +2
  1219.             StrCpy $3 ''
  1220.  
  1221.             IntOp $0 $0 + 0
  1222.             StrCmp${_WORDFUNC_S} $0 0 +5
  1223.             StrCpy $R7 $0 1 0
  1224.             StrCpy $R8 $0 1 1
  1225.             StrCpy $R2 $0 1 2
  1226.             StrCmp${_WORDFUNC_S} $R2 '' filter error
  1227.  
  1228.             restart2:
  1229.             StrCmp${_WORDFUNC_S} $3 '' end
  1230.             StrCpy $R7 ''
  1231.             StrCpy $R8 '+-'
  1232.             goto begin
  1233.  
  1234.             filter:
  1235.             StrCmp${_WORDFUNC_S} $R7 '1' +3
  1236.             StrCmp${_WORDFUNC_S} $R7 '2' +2
  1237.             StrCmp${_WORDFUNC_S} $R7 '3' 0 error
  1238.  
  1239.             StrCmp${_WORDFUNC_S} $R8 '' begin
  1240.             StrCmp${_WORDFUNC_S} $R7$R8 '23' +2
  1241.             StrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3
  1242.             StrCpy $R7 -1
  1243.             goto begin
  1244.             StrCmp${_WORDFUNC_S} $R7$R8 '13' +2
  1245.             StrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3
  1246.             StrCpy $R7 -2
  1247.             goto begin
  1248.             StrCmp${_WORDFUNC_S} $R7$R8 '12' +2
  1249.             StrCmp${_WORDFUNC_S} $R7$R8 '21' 0 error
  1250.             StrCpy $R7 -3
  1251.  
  1252.             begin:
  1253.             StrCpy $R6 0
  1254.             StrCpy $R1 ''
  1255.  
  1256.             loop:
  1257.             StrCpy $R2 $R0 1 $R6
  1258.             StrCmp${_WORDFUNC_S} $R2 '' restartchk
  1259.  
  1260.             StrCmp${_WORDFUNC_S} $2 '' +7
  1261.             StrCpy $R4 0
  1262.             StrCpy $R5 $2 1 $R4
  1263.             StrCmp${_WORDFUNC_S} $R5 '' addsymbol
  1264.             StrCmp${_WORDFUNC_S} $R5 $R2 skipsymbol
  1265.             IntOp $R4 $R4 + 1
  1266.             goto -4
  1267.  
  1268.             StrCmp${_WORDFUNC_S} $1 '' +7
  1269.             StrCpy $R4 0
  1270.             StrCpy $R5 $1 1 $R4
  1271.             StrCmp${_WORDFUNC_S} $R5 '' +4
  1272.             StrCmp${_WORDFUNC_S} $R5 $R2 addsymbol
  1273.             IntOp $R4 $R4 + 1
  1274.             goto -4
  1275.  
  1276.             StrCmp${_WORDFUNC_S} $R7 '1' +2
  1277.             StrCmp${_WORDFUNC_S} $R7 '-1' 0 +4
  1278.             StrCpy $R4 48
  1279.             StrCpy $R5 57
  1280.             goto loop2
  1281.             StrCmp${_WORDFUNC_S} $R8 '+-' 0 +2
  1282.             StrCmp${_WORDFUNC_S} $3 '+' 0 +4
  1283.             StrCpy $R4 $4
  1284.             StrCpy $R5 $5
  1285.             goto loop2
  1286.             StrCpy $R4 $6
  1287.             StrCpy $R5 $7
  1288.  
  1289.             loop2:
  1290.             IntFmt $R3 '%c' $R4
  1291.             StrCmp $R2 $R3 found
  1292.             StrCmp $R4 $R5 notfound
  1293.             IntOp $R4 $R4 + 1
  1294.             goto loop2
  1295.  
  1296.             found:
  1297.             StrCmp${_WORDFUNC_S} $R8 '+-' setcase
  1298.             StrCmp${_WORDFUNC_S} $R7 '3' skipsymbol
  1299.             StrCmp${_WORDFUNC_S} $R7 '-3' addsymbol
  1300.             StrCmp${_WORDFUNC_S} $R8 '' addsymbol skipsymbol
  1301.  
  1302.             notfound:
  1303.             StrCmp${_WORDFUNC_S} $R8 '+-' addsymbol
  1304.             StrCmp${_WORDFUNC_S} $R7 '3' 0 +2
  1305.             StrCmp${_WORDFUNC_S} $R5 57 addsymbol +3
  1306.             StrCmp${_WORDFUNC_S} $R7 '-3' 0 +5
  1307.             StrCmp${_WORDFUNC_S} $R5 57 skipsymbol
  1308.             StrCpy $R4 48
  1309.             StrCpy $R5 57
  1310.             goto loop2
  1311.             StrCmp${_WORDFUNC_S} $R8 '' skipsymbol addsymbol
  1312.  
  1313.             setcase:
  1314.             StrCpy $R2 $R3
  1315.             addsymbol:
  1316.             StrCpy $R1 $R1$R2
  1317.             skipsymbol:
  1318.             IntOp $R6 $R6 + 1
  1319.             goto loop
  1320.  
  1321.             error:
  1322.             SetErrors
  1323.             StrCpy $R0 ''
  1324.             goto end
  1325.  
  1326.             restartchk:
  1327.             StrCpy $R0 $R1
  1328.             StrCmp${_WORDFUNC_S} $2 '' 0 restart1
  1329.             StrCmp${_WORDFUNC_S} $R8 '+-' 0 restart2
  1330.  
  1331.             end:
  1332.             Pop $R8
  1333.             Pop $R7
  1334.             Pop $R6
  1335.             Pop $R5
  1336.             Pop $R4
  1337.             Pop $R3
  1338.             Pop $R2
  1339.             Pop $R1
  1340.             Pop $7
  1341.             Pop $6
  1342.             Pop $5
  1343.             Pop $4
  1344.             Pop $3
  1345.             Pop $2
  1346.             Pop $1
  1347.             Pop $0
  1348.             Exch $R0
  1349.         FunctionEnd
  1350.  
  1351.         !verbose pop
  1352.     !endif
  1353. !macroend
  1354.  
  1355. !macro VersionCompare
  1356.     !ifndef ${_WORDFUNC_UN}VersionCompare
  1357.         !verbose push
  1358.         !verbose ${_WORDFUNC_VERBOSE}
  1359.         !define ${_WORDFUNC_UN}VersionCompare `!insertmacro ${_WORDFUNC_UN}VersionCompareCall`
  1360.  
  1361.         Function ${_WORDFUNC_UN}VersionCompare
  1362.             Exch $1
  1363.             Exch
  1364.             Exch $0
  1365.             Exch
  1366.             Push $2
  1367.             Push $3
  1368.             Push $4
  1369.             Push $5
  1370.             Push $6
  1371.             Push $7
  1372.  
  1373.             begin:
  1374.             StrCpy $2 -1
  1375.             IntOp $2 $2 + 1
  1376.             StrCpy $3 $0 1 $2
  1377.             StrCmp $3 '' +2
  1378.             StrCmp $3 '.' 0 -3
  1379.             StrCpy $4 $0 $2
  1380.             IntOp $2 $2 + 1
  1381.             StrCpy $0 $0 '' $2
  1382.  
  1383.             StrCpy $2 -1
  1384.             IntOp $2 $2 + 1
  1385.             StrCpy $3 $1 1 $2
  1386.             StrCmp $3 '' +2
  1387.             StrCmp $3 '.' 0 -3
  1388.             StrCpy $5 $1 $2
  1389.             IntOp $2 $2 + 1
  1390.             StrCpy $1 $1 '' $2
  1391.  
  1392.             StrCmp $4$5 '' equal
  1393.  
  1394.             StrCpy $6 -1
  1395.             IntOp $6 $6 + 1
  1396.             StrCpy $3 $4 1 $6
  1397.             StrCmp $3 '0' -2
  1398.             StrCmp $3 '' 0 +2
  1399.             StrCpy $4 0
  1400.  
  1401.             StrCpy $7 -1
  1402.             IntOp $7 $7 + 1
  1403.             StrCpy $3 $5 1 $7
  1404.             StrCmp $3 '0' -2
  1405.             StrCmp $3 '' 0 +2
  1406.             StrCpy $5 0
  1407.  
  1408.             StrCmp $4 0 0 +2
  1409.             StrCmp $5 0 begin newer2
  1410.             StrCmp $5 0 newer1
  1411.             IntCmp $6 $7 0 newer1 newer2
  1412.  
  1413.             StrCpy $4 '1$4'
  1414.             StrCpy $5 '1$5'
  1415.             IntCmp $4 $5 begin newer2 newer1
  1416.  
  1417.             equal:
  1418.             StrCpy $0 0
  1419.             goto end
  1420.             newer1:
  1421.             StrCpy $0 1
  1422.             goto end
  1423.             newer2:
  1424.             StrCpy $0 2
  1425.  
  1426.             end:
  1427.             Pop $7
  1428.             Pop $6
  1429.             Pop $5
  1430.             Pop $4
  1431.             Pop $3
  1432.             Pop $2
  1433.             Pop $1
  1434.             Exch $0
  1435.         FunctionEnd
  1436.  
  1437.         !verbose pop
  1438.     !endif
  1439. !macroend
  1440.  
  1441. !macro VersionConvert
  1442.     !ifndef ${_WORDFUNC_UN}VersionConvert
  1443.         !verbose push
  1444.         !verbose ${_WORDFUNC_VERBOSE}
  1445.         !define ${_WORDFUNC_UN}VersionConvert `!insertmacro ${_WORDFUNC_UN}VersionConvertCall`
  1446.  
  1447.         Function ${_WORDFUNC_UN}VersionConvert
  1448.             Exch $1
  1449.             Exch
  1450.             Exch $0
  1451.             Exch
  1452.             Push $2
  1453.             Push $3
  1454.             Push $4
  1455.             Push $5
  1456.             Push $6
  1457.             Push $7
  1458.  
  1459.             StrCmp $1 '' 0 +2
  1460.             StrCpy $1 'abcdefghijklmnopqrstuvwxyz'
  1461.             StrCpy $1 $1 99
  1462.  
  1463.             StrCpy $2 0
  1464.             StrCpy $7 'dot'
  1465.             goto loop
  1466.  
  1467.             preloop:
  1468.             IntOp $2 $2 + 1
  1469.  
  1470.             loop:
  1471.             StrCpy $3 $0 1 $2
  1472.             StrCmp $3 '' endcheck
  1473.             StrCmp $3 '.' dot
  1474.             StrCmp $3 '0' digit
  1475.             IntCmp $3 '0' letter letter digit
  1476.  
  1477.             dot:
  1478.             StrCmp $7 'dot' replacespecial
  1479.             StrCpy $7 'dot'
  1480.             goto preloop
  1481.  
  1482.             digit:
  1483.             StrCmp $7 'letter' insertdot
  1484.             StrCpy $7 'digit'
  1485.             goto preloop
  1486.  
  1487.             letter:
  1488.             StrCpy $5 0
  1489.             StrCpy $4 $1 1 $5
  1490.             IntOp $5 $5 + 1
  1491.             StrCmp $4 '' replacespecial
  1492.             StrCmp $4 $3 0 -3
  1493.             IntCmp $5 9 0 0 +2
  1494.             StrCpy $5 '0$5'
  1495.  
  1496.             StrCmp $7 'letter' +2
  1497.             StrCmp $7 'dot' 0 +3
  1498.             StrCpy $6 ''
  1499.             goto +2
  1500.             StrCpy $6 '.'
  1501.  
  1502.             StrCpy $4 $0 $2
  1503.             IntOp $2 $2 + 1
  1504.             StrCpy $0 $0 '' $2
  1505.             StrCpy $0 '$4$6$5$0'
  1506.             StrLen $4 '$6$5'
  1507.             IntOp $2 $2 + $4
  1508.             IntOp $2 $2 - 1
  1509.             StrCpy $7 'letter'
  1510.             goto loop
  1511.  
  1512.             replacespecial:
  1513.             StrCmp $7 'dot' 0 +3
  1514.             StrCpy $6 ''
  1515.             goto +2
  1516.             StrCpy $6 '.'
  1517.  
  1518.             StrCpy $4 $0 $2
  1519.             IntOp $2 $2 + 1
  1520.             StrCpy $0 $0 '' $2
  1521.             StrCpy $0 '$4$6$0'
  1522.             StrLen $4 $6
  1523.             IntOp $2 $2 + $4
  1524.             IntOp $2 $2 - 1
  1525.             StrCpy $7 'dot'
  1526.             goto loop
  1527.  
  1528.             insertdot:
  1529.             StrCpy $4 $0 $2
  1530.             StrCpy $0 $0 '' $2
  1531.             StrCpy $0 '$4.$0'
  1532.             StrCpy $7 'dot'
  1533.             goto preloop
  1534.  
  1535.             endcheck:
  1536.             StrCpy $4 $0 1 -1
  1537.             StrCmp $4 '.' 0 end
  1538.             StrCpy $0 $0 -1
  1539.             goto -3
  1540.  
  1541.             end:
  1542.             Pop $7
  1543.             Pop $6
  1544.             Pop $5
  1545.             Pop $4
  1546.             Pop $3
  1547.             Pop $2
  1548.             Pop $1
  1549.             Exch $0
  1550.         FunctionEnd
  1551.  
  1552.         !verbose pop
  1553.     !endif
  1554. !macroend
  1555.  
  1556.  
  1557. # Uninstall. Case insensitive. #
  1558.  
  1559. !macro un.WordFindCall _STRING _DELIMITER _OPTION _RESULT
  1560.     !verbose push
  1561.     !verbose ${_WORDFUNC_VERBOSE}
  1562.     Push `${_STRING}`
  1563.     Push `${_DELIMITER}`
  1564.     Push `${_OPTION}`
  1565.     Call un.WordFind
  1566.     Pop ${_RESULT}
  1567.     !verbose pop
  1568. !macroend
  1569.  
  1570. !macro un.WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  1571.     !verbose push
  1572.     !verbose ${_WORDFUNC_VERBOSE}
  1573.     Push `${_STRING}`
  1574.     Push `${_DELIMITER1}`
  1575.     Push `${_DELIMITER2}`
  1576.     Push `${_NUMBER}`
  1577.     Call un.WordFind2X
  1578.     Pop ${_RESULT}
  1579.     !verbose pop
  1580. !macroend
  1581.  
  1582. !macro un.WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  1583.     !verbose push
  1584.     !verbose ${_WORDFUNC_VERBOSE}
  1585.     Push `${_STRING}`
  1586.     Push `${_DELIMITER1}`
  1587.     Push `${_CENTER}`
  1588.     Push `${_DELIMITER2}`
  1589.     Push `${_NUMBER}`
  1590.     Call un.WordFind3X
  1591.     Pop ${_RESULT}
  1592.     !verbose pop
  1593. !macroend
  1594.  
  1595. !macro un.WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  1596.     !verbose push
  1597.     !verbose ${_WORDFUNC_VERBOSE}
  1598.     Push `${_STRING}`
  1599.     Push `${_WORD1}`
  1600.     Push `${_WORD2}`
  1601.     Push `${_NUMBER}`
  1602.     Call un.WordReplace
  1603.     Pop ${_RESULT}
  1604.     !verbose pop
  1605. !macroend
  1606.  
  1607. !macro un.WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
  1608.     !verbose push
  1609.     !verbose ${_WORDFUNC_VERBOSE}
  1610.     Push `${_STRING1}`
  1611.     Push `${_DELIMITER}`
  1612.     Push `${_STRING2}`
  1613.     Call un.WordAdd
  1614.     Pop ${_RESULT}
  1615.     !verbose pop
  1616. !macroend
  1617.  
  1618. !macro un.WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  1619.     !verbose push
  1620.     !verbose ${_WORDFUNC_VERBOSE}
  1621.     Push `${_STRING}`
  1622.     Push `${_DELIMITER}`
  1623.     Push `${_WORD}`
  1624.     Push `${_NUMBER}`
  1625.     Call un.WordInsert
  1626.     Pop ${_RESULT}
  1627.     !verbose pop
  1628. !macroend
  1629.  
  1630. !macro un.StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  1631.     !verbose push
  1632.     !verbose ${_WORDFUNC_VERBOSE}
  1633.     Push `${_STRING}`
  1634.     Push `${_FILTER}`
  1635.     Push `${_INCLUDE}`
  1636.     Push `${_EXCLUDE}`
  1637.     Call un.StrFilter
  1638.     Pop ${_RESULT}
  1639.     !verbose pop
  1640. !macroend
  1641.  
  1642. !macro un.VersionCompareCall _VER1 _VER2 _RESULT
  1643.     !verbose push
  1644.     !verbose ${_WORDFUNC_VERBOSE}
  1645.     Push `${_VER1}`
  1646.     Push `${_VER2}`
  1647.     Call un.VersionCompare
  1648.     Pop ${_RESULT}
  1649.     !verbose pop
  1650. !macroend
  1651.  
  1652. !macro un.VersionConvertCall _VERSION _CHARLIST _RESULT
  1653.     !verbose push
  1654.     !verbose ${_WORDFUNC_VERBOSE}
  1655.     Push `${_VERSION}`
  1656.     Push `${_CHARLIST}`
  1657.     Call un.VersionConvert
  1658.     Pop ${_RESULT}
  1659.     !verbose pop
  1660. !macroend
  1661.  
  1662.  
  1663. !macro un.WordFind
  1664.     !ifndef un.WordFind
  1665.         !verbose push
  1666.         !verbose ${_WORDFUNC_VERBOSE}
  1667.         !undef _WORDFUNC_UN
  1668.         !define _WORDFUNC_UN `un.`
  1669.  
  1670.         !insertmacro WordFind
  1671.  
  1672.         !undef _WORDFUNC_UN
  1673.         !define _WORDFUNC_UN
  1674.         !verbose pop
  1675.     !endif
  1676. !macroend
  1677.  
  1678. !macro un.WordFind2X
  1679.     !ifndef un.WordFind2X
  1680.         !verbose push
  1681.         !verbose ${_WORDFUNC_VERBOSE}
  1682.         !undef _WORDFUNC_UN
  1683.         !define _WORDFUNC_UN `un.`
  1684.  
  1685.         !insertmacro WordFind2X
  1686.  
  1687.         !undef _WORDFUNC_UN
  1688.         !define _WORDFUNC_UN
  1689.         !verbose pop
  1690.     !endif
  1691. !macroend
  1692.  
  1693. !macro un.WordFind3X
  1694.     !ifndef un.WordFind3X
  1695.         !verbose push
  1696.         !verbose ${_WORDFUNC_VERBOSE}
  1697.         !undef _WORDFUNC_UN
  1698.         !define _WORDFUNC_UN `un.`
  1699.  
  1700.         !insertmacro WordFind3X
  1701.  
  1702.         !undef _WORDFUNC_UN
  1703.         !define _WORDFUNC_UN
  1704.         !verbose pop
  1705.     !endif
  1706. !macroend
  1707.  
  1708. !macro un.WordReplace
  1709.     !ifndef un.WordReplace
  1710.         !verbose push
  1711.         !verbose ${_WORDFUNC_VERBOSE}
  1712.         !undef _WORDFUNC_UN
  1713.         !define _WORDFUNC_UN `un.`
  1714.  
  1715.         !insertmacro WordReplace
  1716.  
  1717.         !undef _WORDFUNC_UN
  1718.         !define _WORDFUNC_UN
  1719.         !verbose pop
  1720.     !endif
  1721. !macroend
  1722.  
  1723. !macro un.WordAdd
  1724.     !ifndef un.WordAdd
  1725.         !verbose push
  1726.         !verbose ${_WORDFUNC_VERBOSE}
  1727.         !undef _WORDFUNC_UN
  1728.         !define _WORDFUNC_UN `un.`
  1729.  
  1730.         !insertmacro WordAdd
  1731.  
  1732.         !undef _WORDFUNC_UN
  1733.         !define _WORDFUNC_UN
  1734.         !verbose pop
  1735.     !endif
  1736. !macroend
  1737.  
  1738. !macro un.WordInsert
  1739.     !ifndef un.WordInsert
  1740.         !verbose push
  1741.         !verbose ${_WORDFUNC_VERBOSE}
  1742.         !undef _WORDFUNC_UN
  1743.         !define _WORDFUNC_UN `un.`
  1744.  
  1745.         !insertmacro WordInsert
  1746.  
  1747.         !undef _WORDFUNC_UN
  1748.         !define _WORDFUNC_UN
  1749.         !verbose pop
  1750.     !endif
  1751. !macroend
  1752.  
  1753. !macro un.StrFilter
  1754.     !ifndef un.StrFilter
  1755.         !verbose push
  1756.         !verbose ${_WORDFUNC_VERBOSE}
  1757.         !undef _WORDFUNC_UN
  1758.         !define _WORDFUNC_UN `un.`
  1759.  
  1760.         !insertmacro StrFilter
  1761.  
  1762.         !undef _WORDFUNC_UN
  1763.         !define _WORDFUNC_UN
  1764.         !verbose pop
  1765.     !endif
  1766. !macroend
  1767.  
  1768. !macro un.VersionCompare
  1769.     !ifndef un.VersionCompare
  1770.         !verbose push
  1771.         !verbose ${_WORDFUNC_VERBOSE}
  1772.         !undef _WORDFUNC_UN
  1773.         !define _WORDFUNC_UN `un.`
  1774.  
  1775.         !insertmacro VersionCompare
  1776.  
  1777.         !undef _WORDFUNC_UN
  1778.         !define _WORDFUNC_UN
  1779.         !verbose pop
  1780.     !endif
  1781. !macroend
  1782.  
  1783. !macro un.VersionConvert
  1784.     !ifndef un.VersionConvert
  1785.         !verbose push
  1786.         !verbose ${_WORDFUNC_VERBOSE}
  1787.         !undef _WORDFUNC_UN
  1788.         !define _WORDFUNC_UN `un.`
  1789.  
  1790.         !insertmacro VersionConvert
  1791.  
  1792.         !undef _WORDFUNC_UN
  1793.         !define _WORDFUNC_UN
  1794.         !verbose pop
  1795.     !endif
  1796. !macroend
  1797.  
  1798.  
  1799. # Install. Case sensitive. #
  1800.  
  1801. !macro WordFindSCall _STRING _DELIMITER _OPTION _RESULT
  1802.     !verbose push
  1803.     !verbose ${_WORDFUNC_VERBOSE}
  1804.     Push `${_STRING}`
  1805.     Push `${_DELIMITER}`
  1806.     Push `${_OPTION}`
  1807.     Call WordFindS
  1808.     Pop ${_RESULT}
  1809.     !verbose pop
  1810. !macroend
  1811.  
  1812. !macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  1813.     !verbose push
  1814.     !verbose ${_WORDFUNC_VERBOSE}
  1815.     Push `${_STRING}`
  1816.     Push `${_DELIMITER1}`
  1817.     Push `${_DELIMITER2}`
  1818.     Push `${_NUMBER}`
  1819.     Call WordFind2XS
  1820.     Pop ${_RESULT}
  1821.     !verbose pop
  1822. !macroend
  1823.  
  1824. !macro WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  1825.     !verbose push
  1826.     !verbose ${_WORDFUNC_VERBOSE}
  1827.     Push `${_STRING}`
  1828.     Push `${_DELIMITER1}`
  1829.     Push `${_CENTER}`
  1830.     Push `${_DELIMITER2}`
  1831.     Push `${_NUMBER}`
  1832.     Call WordFind3XS
  1833.     Pop ${_RESULT}
  1834.     !verbose pop
  1835. !macroend
  1836.  
  1837. !macro WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  1838.     !verbose push
  1839.     !verbose ${_WORDFUNC_VERBOSE}
  1840.     Push `${_STRING}`
  1841.     Push `${_WORD1}`
  1842.     Push `${_WORD2}`
  1843.     Push `${_NUMBER}`
  1844.     Call WordReplaceS
  1845.     Pop ${_RESULT}
  1846.     !verbose pop
  1847. !macroend
  1848.  
  1849. !macro WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
  1850.     !verbose push
  1851.     !verbose ${_WORDFUNC_VERBOSE}
  1852.     Push `${_STRING1}`
  1853.     Push `${_DELIMITER}`
  1854.     Push `${_STRING2}`
  1855.     Call WordAddS
  1856.     Pop ${_RESULT}
  1857.     !verbose pop
  1858. !macroend
  1859.  
  1860. !macro WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  1861.     !verbose push
  1862.     !verbose ${_WORDFUNC_VERBOSE}
  1863.     Push `${_STRING}`
  1864.     Push `${_DELIMITER}`
  1865.     Push `${_WORD}`
  1866.     Push `${_NUMBER}`
  1867.     Call WordInsertS
  1868.     Pop ${_RESULT}
  1869.     !verbose pop
  1870. !macroend
  1871.  
  1872. !macro StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  1873.     !verbose push
  1874.     !verbose ${_WORDFUNC_VERBOSE}
  1875.     Push `${_STRING}`
  1876.     Push `${_FILTER}`
  1877.     Push `${_INCLUDE}`
  1878.     Push `${_EXCLUDE}`
  1879.     Call StrFilterS
  1880.     Pop ${_RESULT}
  1881.     !verbose pop
  1882. !macroend
  1883.  
  1884. !macro WordFindS
  1885.     !ifndef WordFindS
  1886.         !verbose push
  1887.         !verbose ${_WORDFUNC_VERBOSE}
  1888.         !undef _WORDFUNC_S
  1889.         !define _WORDFUNC_S `S`
  1890.  
  1891.         !insertmacro WordFind
  1892.  
  1893.         !undef _WORDFUNC_S
  1894.         !define _WORDFUNC_S
  1895.         !verbose pop
  1896.     !endif
  1897. !macroend
  1898.  
  1899. !macro WordFind2XS
  1900.     !ifndef WordFind2XS
  1901.         !verbose push
  1902.         !verbose ${_WORDFUNC_VERBOSE}
  1903.         !undef _WORDFUNC_S
  1904.         !define _WORDFUNC_S `S`
  1905.  
  1906.         !insertmacro WordFind2X
  1907.  
  1908.         !undef _WORDFUNC_S
  1909.         !define _WORDFUNC_S
  1910.         !verbose pop
  1911.     !endif
  1912. !macroend
  1913.  
  1914. !macro WordFind3XS
  1915.     !ifndef WordFind3XS
  1916.         !verbose push
  1917.         !verbose ${_WORDFUNC_VERBOSE}
  1918.         !undef _WORDFUNC_S
  1919.         !define _WORDFUNC_S `S`
  1920.  
  1921.         !insertmacro WordFind3X
  1922.  
  1923.         !undef _WORDFUNC_S
  1924.         !define _WORDFUNC_S
  1925.         !verbose pop
  1926.     !endif
  1927. !macroend
  1928.  
  1929. !macro WordReplaceS
  1930.     !ifndef WordReplaceS
  1931.         !verbose push
  1932.         !verbose ${_WORDFUNC_VERBOSE}
  1933.         !undef _WORDFUNC_S
  1934.         !define _WORDFUNC_S `S`
  1935.  
  1936.         !insertmacro WordReplace
  1937.  
  1938.         !undef _WORDFUNC_S
  1939.         !define _WORDFUNC_S
  1940.         !verbose pop
  1941.     !endif
  1942. !macroend
  1943.  
  1944. !macro WordAddS
  1945.     !ifndef WordAddS
  1946.         !verbose push
  1947.         !verbose ${_WORDFUNC_VERBOSE}
  1948.         !undef _WORDFUNC_S
  1949.         !define _WORDFUNC_S `S`
  1950.  
  1951.         !insertmacro WordAdd
  1952.  
  1953.         !undef _WORDFUNC_S
  1954.         !define _WORDFUNC_S
  1955.         !verbose pop
  1956.     !endif
  1957. !macroend
  1958.  
  1959. !macro WordInsertS
  1960.     !ifndef WordInsertS
  1961.         !verbose push
  1962.         !verbose ${_WORDFUNC_VERBOSE}
  1963.         !undef _WORDFUNC_S
  1964.         !define _WORDFUNC_S `S`
  1965.  
  1966.         !insertmacro WordInsert
  1967.  
  1968.         !undef _WORDFUNC_S
  1969.         !define _WORDFUNC_S
  1970.         !verbose pop
  1971.     !endif
  1972. !macroend
  1973.  
  1974. !macro StrFilterS
  1975.     !ifndef StrFilterS
  1976.         !verbose push
  1977.         !verbose ${_WORDFUNC_VERBOSE}
  1978.         !undef _WORDFUNC_S
  1979.         !define _WORDFUNC_S `S`
  1980.  
  1981.         !insertmacro StrFilter
  1982.  
  1983.         !undef _WORDFUNC_S
  1984.         !define _WORDFUNC_S
  1985.         !verbose pop
  1986.     !endif
  1987. !macroend
  1988.  
  1989.  
  1990. # Uninstall. Case sensitive. #
  1991.  
  1992. !macro un.WordFindSCall _STRING _DELIMITER _OPTION _RESULT
  1993.     !verbose push
  1994.     !verbose ${_WORDFUNC_VERBOSE}
  1995.     Push `${_STRING}`
  1996.     Push `${_DELIMITER}`
  1997.     Push `${_OPTION}`
  1998.     Call un.WordFindS
  1999.     Pop ${_RESULT}
  2000.     !verbose pop
  2001. !macroend
  2002.  
  2003. !macro un.WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
  2004.     !verbose push
  2005.     !verbose ${_WORDFUNC_VERBOSE}
  2006.     Push `${_STRING}`
  2007.     Push `${_DELIMITER1}`
  2008.     Push `${_DELIMITER2}`
  2009.     Push `${_NUMBER}`
  2010.     Call un.WordFind2XS
  2011.     Pop ${_RESULT}
  2012.     !verbose pop
  2013. !macroend
  2014.  
  2015. !macro un.WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
  2016.     !verbose push
  2017.     !verbose ${_WORDFUNC_VERBOSE}
  2018.     Push `${_STRING}`
  2019.     Push `${_DELIMITER1}`
  2020.     Push `${_CENTER}`
  2021.     Push `${_DELIMITER2}`
  2022.     Push `${_NUMBER}`
  2023.     Call un.WordFind3XS
  2024.     Pop ${_RESULT}
  2025.     !verbose pop
  2026. !macroend
  2027.  
  2028. !macro un.WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
  2029.     !verbose push
  2030.     !verbose ${_WORDFUNC_VERBOSE}
  2031.     Push `${_STRING}`
  2032.     Push `${_WORD1}`
  2033.     Push `${_WORD2}`
  2034.     Push `${_NUMBER}`
  2035.     Call un.WordReplaceS
  2036.     Pop ${_RESULT}
  2037.     !verbose pop
  2038. !macroend
  2039.  
  2040. !macro un.WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
  2041.     !verbose push
  2042.     !verbose ${_WORDFUNC_VERBOSE}
  2043.     Push `${_STRING1}`
  2044.     Push `${_DELIMITER}`
  2045.     Push `${_STRING2}`
  2046.     Call un.WordAddS
  2047.     Pop ${_RESULT}
  2048.     !verbose pop
  2049. !macroend
  2050.  
  2051. !macro un.WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
  2052.     !verbose push
  2053.     !verbose ${_WORDFUNC_VERBOSE}
  2054.     Push `${_STRING}`
  2055.     Push `${_DELIMITER}`
  2056.     Push `${_WORD}`
  2057.     Push `${_NUMBER}`
  2058.     Call un.WordInsertS
  2059.     Pop ${_RESULT}
  2060.     !verbose pop
  2061. !macroend
  2062.  
  2063. !macro un.StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
  2064.     !verbose push
  2065.     !verbose ${_WORDFUNC_VERBOSE}
  2066.     Push `${_STRING}`
  2067.     Push `${_FILTER}`
  2068.     Push `${_INCLUDE}`
  2069.     Push `${_EXCLUDE}`
  2070.     Call un.StrFilterS
  2071.     Pop ${_RESULT}
  2072.     !verbose pop
  2073. !macroend
  2074.  
  2075. !macro un.WordFindS
  2076.     !ifndef un.WordFindS
  2077.         !verbose push
  2078.         !verbose ${_WORDFUNC_VERBOSE}
  2079.         !undef _WORDFUNC_S
  2080.         !undef _WORDFUNC_UN
  2081.         !define _WORDFUNC_UN `un.`
  2082.         !define _WORDFUNC_S `S`
  2083.  
  2084.         !insertmacro WordFind
  2085.  
  2086.         !undef _WORDFUNC_UN
  2087.         !define _WORDFUNC_UN
  2088.         !undef _WORDFUNC_S
  2089.         !define _WORDFUNC_S
  2090.         !verbose pop
  2091.     !endif
  2092. !macroend
  2093.  
  2094. !macro un.WordFind2XS
  2095.     !ifndef un.WordFind2XS
  2096.         !verbose push
  2097.         !verbose ${_WORDFUNC_VERBOSE}
  2098.         !undef _WORDFUNC_UN
  2099.         !define _WORDFUNC_UN `un.`
  2100.         !undef _WORDFUNC_S
  2101.         !define _WORDFUNC_S `S`
  2102.  
  2103.         !insertmacro WordFind2X
  2104.  
  2105.         !undef _WORDFUNC_UN
  2106.         !define _WORDFUNC_UN
  2107.         !undef _WORDFUNC_S
  2108.         !define _WORDFUNC_S
  2109.         !verbose pop
  2110.     !endif
  2111. !macroend
  2112.  
  2113. !macro un.WordFind3XS
  2114.     !ifndef un.WordFind3XS
  2115.         !verbose push
  2116.         !verbose ${_WORDFUNC_VERBOSE}
  2117.         !undef _WORDFUNC_UN
  2118.         !define _WORDFUNC_UN `un.`
  2119.         !undef _WORDFUNC_S
  2120.         !define _WORDFUNC_S `S`
  2121.  
  2122.         !insertmacro WordFind3X
  2123.  
  2124.         !undef _WORDFUNC_UN
  2125.         !define _WORDFUNC_UN
  2126.         !undef _WORDFUNC_S
  2127.         !define _WORDFUNC_S
  2128.         !verbose pop
  2129.     !endif
  2130. !macroend
  2131.  
  2132. !macro un.WordReplaceS
  2133.     !ifndef un.WordReplaceS
  2134.         !verbose push
  2135.         !verbose ${_WORDFUNC_VERBOSE}
  2136.         !undef _WORDFUNC_UN
  2137.         !define _WORDFUNC_UN `un.`
  2138.         !undef _WORDFUNC_S
  2139.         !define _WORDFUNC_S `S`
  2140.  
  2141.         !insertmacro WordReplace
  2142.  
  2143.         !undef _WORDFUNC_UN
  2144.         !define _WORDFUNC_UN
  2145.         !undef _WORDFUNC_S
  2146.         !define _WORDFUNC_S
  2147.         !verbose pop
  2148.     !endif
  2149. !macroend
  2150.  
  2151. !macro un.WordAddS
  2152.     !ifndef un.WordAddS
  2153.         !verbose push
  2154.         !verbose ${_WORDFUNC_VERBOSE}
  2155.         !undef _WORDFUNC_UN
  2156.         !define _WORDFUNC_UN `un.`
  2157.         !undef _WORDFUNC_S
  2158.         !define _WORDFUNC_S `S`
  2159.  
  2160.         !insertmacro WordAdd
  2161.  
  2162.         !undef _WORDFUNC_UN
  2163.         !define _WORDFUNC_UN
  2164.         !undef _WORDFUNC_S
  2165.         !define _WORDFUNC_S
  2166.         !verbose pop
  2167.     !endif
  2168. !macroend
  2169.  
  2170. !macro un.WordInsertS
  2171.     !ifndef un.WordInsertS
  2172.         !verbose push
  2173.         !verbose ${_WORDFUNC_VERBOSE}
  2174.         !undef _WORDFUNC_UN
  2175.         !define _WORDFUNC_UN `un.`
  2176.         !undef _WORDFUNC_S
  2177.         !define _WORDFUNC_S `S`
  2178.  
  2179.         !insertmacro WordInsert
  2180.  
  2181.         !undef _WORDFUNC_UN
  2182.         !define _WORDFUNC_UN
  2183.         !undef _WORDFUNC_S
  2184.         !define _WORDFUNC_S
  2185.         !verbose pop
  2186.     !endif
  2187. !macroend
  2188.  
  2189. !macro un.StrFilterS
  2190.     !ifndef un.StrFilterS
  2191.         !verbose push
  2192.         !verbose ${_WORDFUNC_VERBOSE}
  2193.         !undef _WORDFUNC_UN
  2194.         !define _WORDFUNC_UN `un.`
  2195.         !undef _WORDFUNC_S
  2196.         !define _WORDFUNC_S `S`
  2197.  
  2198.         !insertmacro StrFilter
  2199.  
  2200.         !undef _WORDFUNC_UN
  2201.         !define _WORDFUNC_UN
  2202.         !undef _WORDFUNC_S
  2203.         !define _WORDFUNC_S
  2204.         !verbose pop
  2205.     !endif
  2206. !macroend
  2207.  
  2208. !endif
  2209.